package org.feiye.studyday04.practise;

import java.util.Scanner;

public class MaxMin {

	public static void main(String[] args) {
		// 书上第三章练习1
		int num = 0, max = num, min = num;
		Scanner sc = new Scanner(System.in);
		while (true) {
			System.out.println("请输入个整数（输入0结束）：");
			num = sc.nextInt();
			if (num == 0) {
				break;
			} else {
				if (num > max) {
					max = num;
				} else if (num < min) {
					min = num;
				}
			}
		}
		System.out.println("max=" + max + "\t" + "min=" + min);
	}
}

